<?php

declare(strict_types=1);

namespace Modules\Demo\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $parent_id
 * @property $name
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
 * @property $create_time
 * @property $update_time
 */
class CasClass extends Model
{


    protected $table = 'k12_casClass';

    protected $fillable = ['id', 'parent_id', 'name', 'creator_id', 'created_at', 'updated_at', 'deleted_at', 'create_time', 'update_time'];

    /**
     * @var array
     */
    protected array $fields = ['id', 'parent_id', 'name', 'created_at', 'updated_at'];

    /**
     * @var array
     */
    protected array $form = ['parent_id', 'name'];

    /**
     * @var array
     */
    public array $searchable = [
        'name' => 'like',

    ];

    protected bool $isPaginate = false;
    protected bool $asTree = true;

    public function demos()
    {
        return $this->hasMany(Demo::class, 'casClass_id', 'id');
    }
}
